/**
 * 处理不同平台的api之间的差异
 * process.env.TARO_ENV
 * 用于判断当前编译类型，目前有 weapp / swan / alipay / h5 / rn 五个取值
 * */
import Taro from '@tarojs/taro'

export const getLocation = payload => {
  if (process.env.TARO_ENV === 'h5') {
  } else if (process.env.TARO_ENV === 'rn') {
    return Taro.getLocation(payload)
  } else {
    return Taro.getLocation(payload)
  }
}

export const chooseLocation = payload => {
  if (process.env.TARO_ENV == 'h5' || process.env.TARO_ENV == 'rn') {
    console.log('想办法')
  } else {
    return Taro.chooseLocation(payload)
  }
}

export const openLocation = payload => {
  if (process.env.TARO_ENV == 'h5' || process.env.TARO_ENV == 'rn') {
    console.log('想办法')
  } else {
    return Taro.openLocation(payload)
  }
}

export const createMapContext = payload => {
  if (process.env.TARO_ENV == 'h5' || process.env.TARO_ENV == 'rn') {
    console.log('想办法')
  } else {
    return Taro.createMapContext(payload)
  }
}
